package JD;


import java.util.Scanner;

public class Main_0909_2 {
    static int mod=1000000007;
/*    public static long mypow(long x,int n){
        if (x==0) return 0;
        long b=n;
        if (b<0){
            b=-b;
            x=1/x;
        }
        long res=1L;
        while (b>0){
            if ((b&1)==1) res=(res*x)%mod;
            x*=x;
            b>>=1;
        }
        return res%mod;
    }*/
    public static void main(String[] args) {
        //统计出奇数个数，和偶数个数.
        //然后在大于等于2的集合中，排列组合出所有个数大于等于2的子集
        Scanner cin=new Scanner(System.in);
        int n=cin.nextInt();
        int js=0,os=0;
        for (int i = 0; i < n; i++) {
            int num=cin.nextInt();
            if (num%2==0){
                os++;
            }else {
                js++;
            }
        }
        long a=1L,b=1L;
        for (int i = 0; i < js; i++) {
            a=(a*2)%mod;
        }
        for (int i = 0; i < os; i++) {
            b=(b*2)%mod;
        }
        long res= ((a%mod-1-js)+(b%mod-1-os))%mod;
        System.out.println(res);
    }
}
